#include "StdAfx.h"
#include "ToolRun.h"

ToolRun::ToolRun(void) : m_UIRunStart(false)
{
}

ToolRun::~ToolRun(void)
{
}

void ToolRun::Run()
{
	DCore::CoreRun();
}

bool ToolRun::Init()
{
	m_pUIManager = UIManager::GetInstance();

	return true;
}

bool ToolRun::Frame()
{
	if(m_UIRunStart)
	{
		float x = 0, y = 0;
		m_pUIManager->StageFrame(0);
		if(m_pToolPanel->m_HitemBoardMap[m_pToolPanel->m_seletItem] != m_pUIManager->GetFocusBoard() && m_pUIManager->GetFocusBoard() != NULL)
		{	
			m_pToolPanel->m_seletItem= m_pToolPanel->m_BoardHitemMap[m_pUIManager->GetFocusBoard()];
			m_pToolPanel->m_UITree.SelectItem(m_pToolPanel->m_seletItem);
		}
	}
	return true;
}

bool ToolRun::Render()
{
	if(m_UIRunStart)
		m_pUIManager->StageRender(0);



	return true;
}

bool ToolRun::Release()
{
	m_pUIManager->Release();
	return true;
}
